home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d19
/
cal14s6.arc
/
CALLS.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-12-31
|
61KB
|
2,139 lines
{$M 50000,30000,500000} {Stack, minheap, maxheap}
{$L-} {Don't link in ram}
{$S-} {Stack testing}
{$R-} {Range checks}
{$V-} {Relax string rules}
program callers;
uses dos, bufio, crt;
{ PCBoard Call Analyzer Ver. 11.7 02/19/87 }
{ }
{ PCBoard Call Analyzer written by Warren Lauzon of Phoenix AZ }
{ Phoenix Techline PCBoard 602-936-3058 }
{ }
{ (updated for PCBoard 11.8 and PCB ProDOOR, S.H.Smith, 09/02/87) }
{ (updated for PCBoard 12.1 S.H.Smith, 11/20/87) }
const
version = '14s6';
reldate = '12-31-88';
pcbversion = 'For PCBoard v14.0';
type
anystring = string[80];
FileStr = array[1..64] of char;
ItemPointer = ^ItemList;
ItemList = record
name : string[20];
count : longint;
next : ItemPointer;
end;
FilePointer = ^FileRec;
FileRec = record
name : string[16];
count : longint;
size : longint;
higher : FilePointer;
lower : FilePointer;
end;
ProtocolRecord = record
Code : char;
Name : string[20];
Uploads : longint; {count of uploads}
UpTime : real; {time spent uploading}
UpIdeal : real; {ideal time if 100% efficient}
Downloads : longint;
DownTime : real;
DownIdeal : real;
end;
const
ProtocolCount = 27;
Protocol : array[1..ProtocolCount] of ProtocolRecord = (
(Code : 'A'; Name : 'ASCII'),
(Code : 'B'; Name : 'B'),
(Code : 'C'; Name : 'CRC Xmodem'),
(Code : 'D'; Name : 'D'),
(Code : 'E'; Name : 'E'),
(Code : 'F'; Name : 'Full Flow'),
(Code : 'G'; Name : 'Ymodem-G (dsz)'),
(Code : 'H'; Name : 'H'),
(Code : 'I'; Name : 'I'),
(Code : 'J'; Name : 'Jmodem'),
(Code : 'K'; Name : 'Kermit'),
(Code : 'L'; Name : 'Sysop (Local)'),
(Code : 'M'; Name : 'MegaLink'),
(Code : 'N'; Name : 'N'),
(Code : 'O'; Name : '1K-Xmodem'),
(Code : 'P'; Name : 'PCP-Zmodem'),
(Code : 'Q'; Name : 'Q'),
(Code : 'R'; Name : 'Zmodem Resume'),
(Code : 'S'; Name : 'SEAlink'),
(Code : 'T'; Name : 'T'),
(Code : 'U'; Name : 'U'),
(Code : 'V'; Name : 'Overdrive SEAlink'),
(Code : 'W'; Name : 'Window Xmodem'),
(Code : 'X'; Name : 'Xmodem'),
(Code : 'Y'; Name : 'Ymodem Batch'),
(Code : 'Z'; Name : 'Zmodem Batch'),
(Code : '?'; Name : 'Others') {must be last}
);
(* -------------------------------------------------------- *)
const
maxdir = 60;
red: string[7] = #27'[1;31m';
green: string[7] = #27'[1;32m';
yellow: string[7] = #27'[1;33m';
blue: string[7] = #27'[1;34m';
magenta: string[7] = #27'[1;35m';
cyan: string[7] = #27'[0;36m';
white: string[7] = #27'[1;37m';
gray: string[7] = #27'[0m';
var
search_dir: array[1..maxdir] of string[65];
search_dirs: integer;
(* -------------------------------------------------------- *)
var
first_record : word;
total_records : word;
viewmember : longint; {number of arc member textviews}
extarc : longint; {number of arc member extracts}
rearcs : longint; {number of re-archive runs}
arctest : longint; {number of archives tested}
arcview : longint; {number of ARC views}
B1200 : longint;
B19200 : longint; {Baud rate calls}
B2400 : longint;
B300 : longint;
B4800 : longint;
B9600 : longint;
backdos : longint; {number of times back from dos}
batchs : longint; {number of batch transfers}
baud : longint; {current caller's baud rate}
Blocal : longint;
blts : longint; {bulletins read}
caller : longint; {number of callers}
comments : longint; {number of comments}
dirscan : longint; {number of DIR scans}
DOORs : longint; {number of DOORs opened}
DosTimes : longint; {how many times dropped to DOS}
down : longint; {number of downloads}
d_abort : longint; {number of download aborts}
elapsed_time : real; {how long it takes the program to run}
Endtime : real; {End time for program start}
events : longint; {event timer activated}
even_parity : longint; {7E callers}
free_down : longint; {free downloads}
graphics : longint; {graphics callers}
joins : longint; {number of conference joins}
kills : longint; {messages killed}
lockouts : longint; {Automatic lockouts done}
logsize : word;
mssgs : longint; {messages left}
new_guys : longint; {new users registered}
non_graphics : longint; {non-graphics callers}
outfile : anystring; {output filename}
PAGE : longint; {sysop pages}
pwfail : longint; {password fails}
question : longint; {main questionnaire answered}
refused : longint; {refused to register}
secviol : longint; {security violations}
start_time : real; {0 time for program start}
stuff : longint;
sysop_local : longint; {local sysop sessions}
sysop_remote : longint; {remote sysop sessions}
tcan : longint; {number of trashcan name attempts}
time_limit : longint; {daily time limit exceeded}
TotHours : real; {Total hours from first to last log entry}
UniqFiles : longint; {number of dIfferent files}
up : longint; {number of uploads}
u_abort : longint; {number of upload aborts}
min_download : longint; {minimum nummber of downloads to include in report}
arcmail : longint; {number of ARCM runs}
msgcount : longint; {number of ARCM messges}
invalids : longint; {number of invalid uploads}
schat : longint; {sysop chat initiated}
nchat: longint; {node chat initiated}
UsedMinutes : longint; {time used, minutes}
Hours : longint; {time used, hours}
mins_dn : longint; {minutes spent downloading}
mins_up : longint; {minutes spent uploading}
mins_schat: longint; {minutes spent in sysop-chat mode}
mins_nchat: longint; {minutes spent in node-chat mode}
DosTime : longint; {time spent in remote DOS}
spare1 : longint;
spare2 : longint;
spare3 : longint;
spare4 : longint;
spare5 : longint;
spare6 : longint;
spare7 : longint;
spare8 : longint;
spare9 : longint;
Inrec : FileStr; {64 char line}
PeriodCovered : anystring; {concats to send to ofd}
reports : anystring; {list of reports to produce}
first_rec : string[64]; {first entry in log}
{table of peak hours, 'Y'=peak, anything else=not}
PeakTable: string[24];
Hrs : array[0..23] of longint; {minutes used by hours}
DiskFile : buffered_file;
FileTree : FilePointer;
FirstBatch : ItemPointer;
FirstBullet : ItemPointer;
FirstConf : ItemPointer;
FirstDoor : ItemPointer;
ofd : text; {file that goes to the bulletin}
filever: integer;
const
graph_num = 100;
graph_set : string[3] = '░▓▒';
type
sort_keys = (percent_sort, name_sort, no_sort);
var
graph_min,
graph_max : longint;
graph_lim : real;
graph_line : longint;
graph_val : array[1..graph_num] of real;
graph_title : array[1..graph_num] of string[20];
graph_count : integer;
(* -------------------------------------------------------- *)
procedure section_title(title : anystring);
begin
writeln(ofd);
writeln(ofd, '' : 35-(length(title) div 2),
red, '-= ', yellow, title, red, ' =-');
writeln(ofd);
end;
procedure empty_section;
begin
writeln(ofd, gray, '':34,'**NONE**');
end;
procedure start_graph(title : anystring; limit : real);
begin
graph_lim := limit;
graph_max := 0;
graph_min := 100;
graph_line := 0;
graph_count := 0;
section_title(title);
end;
procedure graph(item : anystring; n : real);
var
pct : real;
begin
if graph_lim = 0 then
pct := 0
else
pct := abs(n/graph_lim)*100.0;
if (pct <= 0) or (pct > maxint) then
exit;
{ if pct > 100 then
pct := 100; }
if pct > graph_max then
graph_max := trunc(pct);
if pct < graph_min then
graph_min := trunc(pct*0.7);
if graph_count < graph_num then
inc(graph_count);
graph_val[graph_count] := n;
graph_title[graph_count] := item;
end;
procedure graph_output(item : anystring; n : real);
var
pct : real;
i : integer;
w : integer;
lim : longint;
begin
if graph_line < length(graph_set) then
inc(graph_line)
else
graph_line := 1;
if graph_lim = 0 then
pct := 0
else
pct := abs(n/graph_lim*100.0);
if pct > 100 then
pct := 100;
write(ofd, green, item:20, ': ', white);
if graph_lim < 0 then
if pct >= 100 then
write(ofd,' 100% ')
else
write(ofd, pct:4:1, '% ')
else
begin
if int(graph_lim) <> graph_lim then
write(ofd, n:5:1)
else
write(ofd, n:4:0);
if pct >= 100 then
write(ofd,gray, ' ( 100%) ')
else
write(ofd,gray,' (', pct:4:1, '%) ');
end;
if graph_lim < 0 then lim := 50 else lim := 42;
if (pct < graph_min) then
w := 0
else
if (graph_min = graph_max) then
w := lim
else
w := round((pct-graph_min)/(graph_max-graph_min)*lim);
if w > lim then
w := lim;
write(ofd, white, '│', cyan);
for i := 1 to w-1 do
write(ofd, graph_set[graph_line]);
if w > 0 then
write(ofd, white, '█');
writeln(ofd);
end;
procedure sort_graph(onkey: sort_keys);
var
ts : string[20];
tv : real;
swap : boolean;
i,j : integer;
function swap_needed: boolean;
begin
if onkey = percent_sort then
tv := graph_val[i]-graph_val[i+1]
else
tv := 0;
if tv = 0 then
if graph_title[i] > graph_title[i+1] then
tv := -1;
swap_needed := (tv < 0);
end;
procedure swap_entries;
begin
swap := true;
tv := graph_val[i+1];
graph_val[i+1] := graph_val[i];
graph_val[i] := tv;
ts := graph_title[i+1];
graph_title[i+1] := graph_title[i];
graph_title[i] := ts;
end;
begin
j := graph_count;
repeat
swap := false;
dec(j);
for i := 1 to j do
if swap_needed then
swap_entries;
until swap = false;
end;
procedure end_graph(onkey: sort_keys);
var
i : integer;
begin
if onkey <> no_sort then
sort_graph(onkey);
for i := 1 to graph_count do
graph_output(graph_title[i], graph_val[i]);
if graph_count = 0 then
empty_section;
writeln(ofd);
end;
(* -------------------------------------------------------- *)
procedure graph_list(node: ItemPointer;
title: string;
n: real; key: sort_keys);
begin
start_graph(title,n);
while node <> nil do
begin
graph(node^.name, node^.count);
node := node^.next;
end;
end_graph(key);
end;
(* -------------------------------------------------------- *)
procedure walk_tree( var Node : FilePointer;
var a : integer);
{traverse the binary filename tree and output in sorted order}
begin
if Node = nil then exit;
walk_tree(Node^.lower, a);
if Node^.count >= min_download then
begin
case Node^.count-min_download of
0.. 2: write(ofd, cyan, ' ');
3.. 6: write(ofd, green, ' * ');
7..12: write(ofd, red, ' ** ');
13..24: write(ofd, yellow, ' *** ');
else write(ofd, white, '**** ');
end;
write(ofd, Node^.name : 12, Node^.count : 5);
if a mod 3 = 0 then
writeln(ofd)
else
write(ofd,' ');
inc(a);
end;
walk_tree(Node^.higher, a);
end;
(* -------------------------------------------------------- *)
procedure output_results(outfile: anystring);
var
UsedHours : real;
H24 : real;
DownEffic : real;
UpEffic : real;
temp : anystring;
Days : longint;
report : integer;
c: char;
PeakUsed : real;
PeakHours : real;
procedure init_report;
var
i,j: integer;
begin
gotoxy(15, 15);
HIGHVIDEO;
textcolor(14);
gotoxy(1, 2);
write('Sending output to ', outfile,' ');
gotoxy(1, 24);
assign(ofd, outfile);
rewrite(ofd);
UsedHours := int(UsedMinutes)/60.0+int(Hours);
if TotHours < 1 then
TotHours := 1;
Days := trunc((TotHours+23.0)/24.0);
str(days,temp);
{calculate number of hours in peak times}
i := 0;
for j := 0 to 23 do
if PeakTable[j+1] = 'Y' then
inc(i);
if i = 0 then
i := 24;
PeakHours := TotHours / 24.0 * int(i);
{calculate time used in peak times}
if i = 24 then
PeakUsed := UsedHours
else
begin
PeakUsed := 0;
for j := 0 to 23 do
if PeakTable[j+1] = 'Y' then
PeakUsed := PeakUsed + int(hrs[j])/60.0;
end;
writeln(ofd,white);
writeln(ofd, ' Calls ', version, ' - Call Analyzer ',pcbversion);
writeln(ofd, blue, ' ', PeriodCovered);
end;
procedure system_statistics;
begin
section_title('System Statistics for '+temp+' days');
write (ofd, green, ' Archive REPAK Runs .... ', white, rearcs:6);
writeln(ofd, green, ' Comments Left ......... ':33, white, comments:6);
write (ofd, green, ' Archive Texts Viewed .. ', white, viewmember:6);
writeln(ofd, green, ' Messages Left ......... ':33, white, mssgs:6);
write (ofd, green, ' Archive Extracts ...... ', white, extarc:6);
writeln(ofd, green, ' Archive Mail Runs ..... ':33, white, arcmail:6);
write (ofd, green, ' Archives Tested ....... ', white, arctest:6);
writeln(ofd, green, ' Archive Mail Messages . ':33, white, msgcount:6);
write (ofd, green, ' Archives Viewed ....... ', white, arcview:6);
writeln(ofd, green, ' Number of Callers ..... ':33, white, caller:6);
write (ofd, green, ' Directory Scans ....... ', white, dirscan:6);
writeln(ofd, green, ' New Users Registered .. ':33, white, new_guys:6);
write (ofd, green, ' Doors Opened .......... ', white, DOORs:6);
writeln(ofd, green, ' Questionnaire Answered. ':33, white, question:6);
write (ofd, green, ' Downloads Aborted ..... ', white, d_abort:6);
writeln(ofd, green, ' Average Call Length ... ':33, white, (UsedHours*60)/caller:6:1);
write (ofd, green, ' Downloads Completed ... ', white, down:6);
writeln(ofd, green, ' Average Idle Time ..... ':33, white, (TotHours-UsedHours)*60/caller:6:1);
write (ofd, green, ' Different Files Dnld .. ', white, UniqFiles:6);
writeln(ofd, green, ' Calls per day (avg) ... ':33, white, caller/Days:6:1);
write (ofd, green, ' Free downloads ........ ', white, free_down:6);
writeln(ofd, green, ' Time Used, Hours ...... ':33, white, UsedHours:6:1);
write (ofd, green, ' Uploads Aborted ....... ', white, u_abort:6);
writeln(ofd, green, ' Total Operation Hours . ':33, white, TotHours:6:1);
write (ofd, green, ' Uploads Completed ..... ', white, up:6);
writeln(ofd, green, ' Total Utilization % ... ':33, white, (UsedHours/TotHours)*100:6:1);
write (ofd, green, ' Bad archives deleted .. ', white, invalids:6);
writeln(ofd, green, ' Peak Utilization % .... ':33, white, (PeakUsed/PeakHours)*100:6:1);
writeln(ofd);
end;
procedure security_statistics;
begin
section_title('Security Statistics');
write (ofd, '':32);
writeln(ofd, green, ' Node Chats Initiated... ':33, white, nchat:6);
write (ofd, green, ' Automatic Lockouts .... ', white, lockouts:6);
writeln(ofd, green, ' Sysop Chats Initiated.. ':33, white, schat:6);
write (ofd, green, ' Password Failures ..... ', white, pwfail:6);
writeln(ofd, green, ' Sysop Paged ........... ':33, white, PAGE:6);
write (ofd, green, ' Refused to Register ... ', white, refused:6);
writeln(ofd, green, ' Sysop Sessions ........ ':33, white, sysop_local+sysop_remote:6);
write (ofd, green, ' Remote DOS Time (min) . ', white, DosTime:6);
writeln(ofd, green, ' Time Limit Expired .... ':33, white, time_limit:6);
write (ofd, green, ' Remote Drops to DOS ... ', white, DosTimes:6);
writeln(ofd, green, ' Trashcan Names ........ ':33, white, tcan:6);
write (ofd, green, ' Scheduled Events ...... ', white, events:6);
writeln(ofd, green, ' Security Violations ... ':33, white, secviol:6);
writeln(ofd);
end;
procedure graphic_modes;
var
k: longint;
begin
k := (graphics+non_graphics+even_parity);
start_graph('Graphics Modes', k);
graph('Color Graphics', graphics);
graph('Non Graphics', non_graphics);
graph('7 Bit Even-Parity', even_parity);
end_graph(percent_sort);
end;
procedure baud_rates;
begin
start_graph('Baud Rates', B19200+B9600+B4800+B2400+B1200+B300);
graph('19200 Baud', B19200);
graph('9600 Baud', B9600);
graph('4800 Baud', B4800);
graph('2400 Baud', B2400);
graph('1200 Baud', B1200);
graph('300 Baud', B300);
end_graph(no_sort);
end;
procedure hourly_usage;
var
hits: longint;
slot: integer;
a: integer;
k: integer;
begin
section_title('Average Percent of Hourly Usage');
if TotHours > 24 then H24 := (TotHours/24)*(60/100)
else H24 := 0.60;
hits := 0;
for k := 20 downto 1 do
{if hits < 24 then}
begin
write(ofd, green, k*5 : 3, '%', white, ' │ ');
hits := 0;
for a := 0 to 23 do
begin
c := graph_set[(a mod 3)+1];
slot := trunc((hrs[a] / H24) / 5);
if slot > 20 then slot := 20;
if slot = k then
write(ofd, white, '██ ')
else
if slot > k then
begin
write(ofd, cyan, c,c,' ');
inc(hits);
end
else
write(ofd, blue, ' · ');
end;
writeln(ofd);
end;
write(ofd, green, ' 00');
for a := 1 to 23 do
write(ofd,a:3);
writeln(ofd);
write(ofd, yellow, 'Peak: ', magenta);
for a := 0 to 23 do
if PeakTable[a+1] = 'Y' then
write(ofd,' **')
else
write(ofd,' ');
writeln(ofd);
writeln(ofd);
end;
procedure conferences_joined;
begin
graph_list(FirstConf,'Conferences Joined', joins, percent_sort);
end;
procedure bulletins_read;
begin
graph_list(FirstBullet,'Bulletins Read', blts, percent_sort);
end;
procedure doors_opened;
begin
graph_list(FirstDoor,'Doors Opened', DOORs, percent_sort);
end;
procedure time_distribution;
begin
end;
procedure download_protocols;
var
k: integer;
begin
start_graph('Protocol Usage (Downloading)', down);
for k := 1 to ProtocolCount do
with Protocol[k] do
if (Downloads <> 0) then
graph(Name, Downloads);
end_graph(percent_sort);
end;
procedure download_efficiency;
var
k: integer;
begin
start_graph('Average Protocol Efficiency (Downloading)', -100);
for k := 1 to ProtocolCount do
with Protocol[k] do
if (Downloads <> 0) and (DownTime <> 0) then
begin
DownEffic := 100.0*DownIdeal/DownTime;
graph(Name, DownEffic);
end;
end_graph(percent_sort);
end;
procedure upload_protocols;
var
k: integer;
begin
start_graph('Protocol Usage (Uploading)', up);
for k := 1 to ProtocolCount do
with Protocol[k] do
if (Uploads <> 0) then
graph(Name, Uploads);
end_graph(percent_sort);
end;
procedure upload_efficiency;
var
k: integer;
begin
start_graph('Average Protocol Efficiency (Uploading)', -100);
for k := 1 to ProtocolCount do
with Protocol[k] do
if (Uploads <> 0) and (UpTime <> 0) then
begin
UpEffic := 100.0*UpIdeal/UpTime;
graph(Name, UpEffic);
end;
end_graph(percent_sort);
end;
procedure batch_sizes;
begin
graph_list(FirstBatch,'Batch Transfer Sizes', batchs, name_sort);
end;
procedure files_downloaded;
var
a: integer;
begin
section_title('Files Downloaded');
if down < 1 then
empty_section
else
begin
a := 1;
walk_tree(FileTree, a);
end;
writeln(ofd);
end;
(* -------------------------------------------------------- *)
begin
init_report;
for report := 1 to length(reports) do
case upcase(reports[report]) of
'A': system_statistics;
'B': graphic_modes;
'C': baud_rates;
'D': hourly_usage;
'E': conferences_joined;
'F': bulletins_read;
'G': doors_opened;
'H': download_protocols;
'I': download_efficiency;
'J': upload_protocols;
'K': upload_efficiency;
'L': batch_sizes;
'M': files_downloaded;
'N': security_statistics;
'O': time_distribution;
'Z': writeln(ofd);
end;
write(ofd,gray);
close(ofd);
end;
(* -------------------------------------------------------- *)
procedure getrec;
var
c: char;
begin
bread(DiskFile, Inrec);
if keypressed then
begin
c := readkey;
if c = #27 then
begin
gotoxy(1, 24);
writeln('** ESC pressed - Aborted **');
delay(2000);
halt;
end;
end;
end;
(* -------------------------------------------------------- *)
function get_file_size(name: string): longint;
{get the size of a file; somewhere in download paths}
var
path: string;
i: integer;
DirInfo: SearchRec;
begin
(***
name[9] := '.';
repeat
i := pos(' ',name);
if i >0 then
delete(name,i,1);
until i = 0;
for i := 1 to search_dirs do
begin
path := search_dir[i] + '\' + name;
FindFirst(path,$21,DirInfo);
if (DosError = 0) then
begin
gotoxy(23,3);
write('File: ',name:12,' Size:',dirinfo.size:7);
get_file_size := DirInfo.size;
exit;
end;
end;
gotoxy(23,3);
write('File: ',name:12,' Not found! ');
***)
get_file_size := 60000;
end;
(* -------------------------------------------------------- *)
procedure add_item(var FirstItem : ItemPointer;
ItemName : anystring;
Number : integer);
var
NewItem : ItemPointer;
begin
NewItem := FirstItem;
while NewItem <> nil do
if NewItem^.name = ItemName then
begin
NewItem^.count := NewItem^.count + Number;
exit;
end
else
NewItem := NewItem^.next;
new(NewItem); { get a new record}
NewItem^.next := FirstItem;
FirstItem := NewItem;
NewItem^.name := ItemName;
NewItem^.count := Number;
end;
(* -------------------------------------------------------- *)
procedure store_name(var Node : FilePointer;
var Name : anystring;
var Size : longint);
{stores the name in the sorted name tree; recursive}
begin
(* insert new nodes *)
if Node = nil then
begin
new(Node);
Node^.count := 1;
Node^.name := Name;
Node^.size := get_file_size(Name);
Size := Node^.size;
Node^.higher := nil;
Node^.lower := nil;
inc(UniqFiles);
end
else
(* count existting nodes *)
if Node^.name = Name then
begin
inc(Node^.count);
Size := Node^.size;
end
else
(* else traverse the tree looking for the right node *)
if Name > Node^.name then
store_name(Node^.higher,Name,Size)
else
store_name(Node^.lower,Name,Size);
end;
(* -------------------------------------------------------- *)
type
str12 = string[12];
str80 = string[80];
{ This Function returns a name expanded to line up both the name and ext }
{ for example: abc.com = abc com }
{ datafile.1 = datafile 1 }
function ExpandName(name : str12) : str12;
var
Counter, DotPos : integer;
begin
DotPos := pos('.', name); {where's the dot at?}
if DotPos = 0 then begin
repeat
name := name+' '; {If no ext, pad with spaces}
until length(name) = 12;
end else begin
delete(name, DotPos, 1);
repeat
insert(' ', name, DotPos);
until length(name) = 12;
end;
ExpandName := name;
end;
(* -------------------------------------------------------- *)
procedure print(col, row : integer;
str : str80;
Attrib : integer);
begin
gotoxy(col, row);
textcolor(Attrib);
write(str);
end;
(* -------------------------------------------------------- *)
function Time : real;
var
Reg : Registers;
begin Reg.AX := $2C00;
intr($21, Reg);
Time := (Reg.CX shr 8)*3600 {Hours}
+(Reg.CX and $00FF)*60 {Minutes}
+(Reg.DX shr 8) { * 1 }
{Seconds }
+(Reg.DX and $00FF)/100; {Hundredths }
end;
(* -------------------------------------------------------- *)
procedure incaller;
var
Str30 : string[30];
posit : integer;
str20 : string[20];
begin
if pos('New', Inrec) > 0 then
exit;
if pos('Off', Inrec) > 0 then
exit;
if pos(' SYSOP (', Inrec) > 0 then
begin
if pos(' (Local) (', Inrec) > 0 then inc(sysop_local)
else inc(sysop_remote);
end;
if pos(' (Local) (', Inrec) <> 0 then baud := 0
else if pos(' (19200) (', Inrec) <> 0 then baud := 19200
else if pos(' (9600) (', Inrec) <> 0 then baud := 9600
else if pos(' (4800) (', Inrec) <> 0 then baud := 4800
else if pos(' (2400) (', Inrec) <> 0 then baud := 2400
else if pos(' (1200) (', Inrec) <> 0 then baud := 1200
else if pos(' (300) (', Inrec) <> 0 then baud := 300;
case baud of
19200 : begin
inc(B19200);
baud := 13000; {highest effective speed}
end;
9600 : inc(B9600);
4800 : inc(B4800);
2400 : inc(B2400);
1200 : inc(B1200);
300 : inc(B300);
else inc(Blocal);
end;
if pos('(G', Inrec) > 0 then inc(graphics)
else if pos('(N', Inrec) > 0 then inc(non_graphics)
else if pos('(7', Inrec) > 0 then inc(even_parity);
caller := Blocal+B300+B1200+B2400+B4800+B9600+B19200;
if pos('Trashcan', Inrec) > 0 then inc(tcan);
end;
(* -------------------------------------------------------- *)
procedure indownload; {upload/downloaded file stuff}
var
prot : char;
posit : integer;
k : integer;
CPS : real;
FileName : string[12];
tmp: string;
size : longint;
ideal : real;
Time : real;
begin
if pos(' Aborted using ', Inrec) > 12 then
begin
if inrec[8] = 'D' then
inc(d_abort) {Aborted dl's}
else
inc(u_abort);
exit;
end;
if inrec[8] = 'D' then
inc(down)
else
inc(up);
{determine file name}
posit := pos(' Completed using ', Inrec); {find End of name}
if posit=0 then exit;
FileName := copy(Inrec, 11, (posit-11));
FileName := ExpandName(FileName);
if FileName[1] = ' ' then exit;
{store name, return file size}
store_name(FileTree,FileName,size);
{determine transfer time}
if baud <> 0 then
ideal := size/baud*10.0
else
ideal := 111;
{determine actual transfer time}
posit := pos('CPS=', Inrec);
if posit = 0 then
CPS := baud/11.0
else
begin
tmp := copy(inrec,posit+4,6);
posit := pos(' ',tmp);
tmp := copy(tmp,1,posit-1);
CPS := 0;
val(tmp,cps,posit);
end;
if (CPS < 20) or (CPS > (baud/5.0)) then
begin
Time := 0; {don't consider aborted or invalid transfers}
ideal := 0;
end
else
Time := size/CPS;
if inrec[8] = 'D' then
begin
inc(down);
mins_dn := mins_dn + round(Time/60.0);
end
else
begin
inc(up);
mins_up := mins_up + round(Time/60.0);
end;
{determine protocol and find table entry}
posit := pos('using ', Inrec);
prot := Inrec[posit+6];
for k := 1 to ProtocolCount do
with Protocol[k] do
if (Code = prot) or (Code = '?') then
begin
if Code = '?' then
begin
gotoxy(1,3);
writeln('Unknown protocol: ',Inrec);
end;
if Inrec[8] = 'D' then
begin
inc(Downloads);
DownTime := DownTime+Time;
DownIdeal := DownIdeal+ideal;
end
else
begin
inc(Uploads);
UpTime := UpTime+Time;
UpIdeal := UpIdeal+ideal;
end;
exit;
end;
end;
(* -------------------------------------------------------- *)
procedure confjoin; {conferences joined}
var
posit : integer;
ConfName : anystring;
begin
posit := pos(' Conference', Inrec);
if posit < 8 then
exit;
ConfName := copy(Inrec, 7, 10);
posit := pos(' ',ConfName);
if posit > 0 then
ConfName[0] := chr(posit-1);
case ConfName[1] of
'0'..'9', 'a'..'z', 'A'..'Z':
begin
inc(joins);
add_item(FirstConf, ConfName, 1);
end;
end;
end;
(* -------------------------------------------------------- *)
procedure batch; {batch transfer}
var
posit : integer;
num : integer;
temp : anystring;
BatchName : anystring;
begin
posit := pos(' files', Inrec);
temp := copy(Inrec,7,posit-7);
num := 0;
val(temp,num,posit);
if num < 1 then
exit;
if Inrec[posit+7] = '0' then
exit;
str(num:2,temp);
if num = 1 then
BatchName := ' Single Files'
else
BatchName := temp + ' Files';
batchs := batchs + num;
add_item(FirstBatch, BatchName, num);
end;
(* -------------------------------------------------------- *)
procedure arcmsgs; {archived message count}
var
posit : integer;
num : integer;
begin
posit := pos(' messa', Inrec);
num := 0;
val(copy(Inrec,7,posit-7),num,posit);
if num < 1 then
exit;
msgcount := msgcount + num;
end;
(* -------------------------------------------------------- *)
type
Days = integer;
var
numdays : integer;
function finday(Days : integer) : integer;
begin
case Days of
12 : numdays := 334;
11 : numdays := 304;
10 : numdays := 273;
9 : numdays := 243;
8 : numdays := 212;
7 : numdays := 181;
6 : numdays := 151;
5 : numdays := 120;
4 : numdays := 90;
3 : numdays := 59;
2 : numdays := 31;
1 : numdays := 0;
end; {case}
finday := numdays;
end;
(* -------------------------------------------------------- *)
procedure openfiles;
var
end_hours: real;
beg_hours: real;
mostr, daystr : integer;
YrStr, Fract : real;
Num_Days : integer;
TX : string[62];
first_entry : string[19]; {first entry in log}
last_entry : string[19]; {last entry in log}
a: integer;
inName : string[65];
begin
if paramcount = 0 then
InName := 'CALLERS'
else
InName := paramstr(1);
bopen(DiskFile,InName,200,sizeof(InRec));
if berr then
begin
writeln('Cant open caller file: ',InName);
halt(1);
end;
bseekeof(DiskFile);
total_records := btell(DiskFile);
if total_records < 4 then
begin
gotoxy(1,24);
writeln('Empty caller log - No action taken');
halt(99);
end;
bseek(DiskFile, total_records-1);
getrec;
if inrec[3] <> '-' then {check for bad EOF}
begin
repeat
dec(total_records);
bseek(DiskFile, total_records-1);
getrec;
until (inrec[3] = '-') or (total_records < 2);
end;
{decode the last log entry}
dec(total_records);
bseek(DiskFile, total_records);
getrec;
last_entry := copy(Inrec, 11, 5)+' '+copy(Inrec, 1, 8);
TX := concat('Last log entry: '+Inrec);
print(3, 23, TX, 10);
val(copy(last_entry, 7, 2), mostr, a); {get month}
val(copy(last_entry, 10, 2), daystr, a); {get day}
val(last_entry[14], YrStr, a); {last digit of year}
val(copy(last_entry, 1, 2), end_hours, a); {hour digit of logon}
if end_hours > 23 then
end_hours := end_hours - 24;
val(copy(last_entry, 4, 2), Fract, a);
Fract := Fract/60;
Num_Days := finday(mostr);
end_hours := end_hours + (YrStr*24*365) + Fract + (Num_Days+daystr)*24;
{decode the beginning of the logfile}
first_record := 0;
repeat
inc(first_record);
bseek(DiskFile, first_record);
getrec;
until (Inrec[3] = '-') or (first_record >= total_records);
if first_rec = '' then
first_rec := Inrec;
first_entry := copy(first_rec, 11, 5)+' '+copy(first_rec, 1, 8);
TX := 'First log entry: '+first_rec;
print(3, 22, TX, 10);
val(copy(first_entry, 7, 2), mostr, a);
val(copy(first_entry, 10, 2), daystr, a);
val(first_entry[14], YrStr, a);
val(copy(first_entry, 1, 2), beg_hours, a);
if beg_hours > 23 then
beg_hours := beg_hours - 24;
val(copy(first_entry, 4, 2), Fract, a);
Fract := Fract/60;
Num_Days := finday(mostr);
beg_hours := beg_hours + (YrStr*24*365) + Fract + (Num_Days+daystr)*24;
{determine the period involved}
PeriodCovered := 'Period covered: From '+first_entry+' to '+last_entry;
print(3, 21, PeriodCovered, 13);
TotHours := end_hours-beg_hours;
str(TotHours : 5 : 1, TX);
TX := concat('Total Hours of Operation: ', TX);
print(3, 19, TX, 15);
logsize := total_records;
str(logsize : 5, TX);
TX := concat('Total Records in the Callers file: ', TX);
print(3, 20, TX, crt.yellow);
if total_records < 4 then
begin
gotoxy(1,24);
writeln('Empty caller log - No action taken');
halt(99);
end;
dec(total_records,2);
incaller;
end;
(* -------------------------------------------------------- *)
procedure bulletins;
var
posit : integer;
BltNumber: anystring;
BltName: anystring;
begin
BltName := copy(Inrec, 22, 10);
posit := pos(' ', BltName);
if posit > 0 then
BltName[0] := chr(posit-1);
if length(BltName) = 0 then
exit;
posit := pos('#', Inrec);
if posit = 0 then
exit;
BltNumber := copy(Inrec,posit+2,4);
posit := pos(' ', BltNumber);
if posit > 0 then
BltNumber[0] := chr(posit-1);
while length(BltNumber) < 3 do
BltNumber := ' ' + BltNumber;
BltName := BltName + ' #' + BltNumber;
inc(blts);
add_item(FirstBullet, BltName, 1);
end; {bulletins}
(* -------------------------------------------------------- *)
procedure pdoors;
var
posit : integer;
DoorName : string[40];
begin
if pos(' at ', Inrec) = 0 then exit;
posit := pos('(', Inrec);
DoorName := copy(Inrec, posit+1, pos(')', Inrec)-posit-1);
posit := 1;
repeat
if DoorName[posit] = '\' then
begin
DoorName := copy(DoorName, posit+1, 99);
posit := 1;
end
else
posit := posit+1;
until posit = length(DoorName);
inc(DOORs);
add_item(FirstDoor, DoorName, 1);
end;
(* -------------------------------------------------------- *)
procedure DOSdrop;
var
DT1, DT2 : integer;
a: integer;
begin
val(copy(Inrec, 34, 2), DT1, a); {exit to DOS time}
getrec;
val(copy(Inrec, 27, 2), DT2, a); {back from DOS time}
if a = 0 then
begin
DT1 := (DT2-DT1);
if DT1 < 0 then DT1 := DT1+60; {adjust for hour rollover}
DosTime := DosTime+DT1;
end;
inc(DosTimes);
end;
(* -------------------------------------------------------- *)
procedure sysop_chat;
var
DT1, DT2 : integer;
a: integer;
node: boolean;
begin
node := (inrec[7] = 'N');
val(copy(Inrec, 34, 2), DT1, a); {chat started time time}
getrec;
val(copy(Inrec, 27, 2), DT2, a); {chat ended time}
if a = 0 then
begin
DT1 := (DT2-DT1);
if DT1 < 0 then DT1 := DT1+60; {adjust for hour rollover}
if node then
mins_nchat := mins_nchat + DT1
else
mins_schat := mins_schat + DT1;
end;
if node then
inc(nchat)
else
inc(schat);
end;
(* -------------------------------------------------------- *)
procedure catchall;
begin
if pos(' CHAT ', Inrec) > 0 then sysop_chat
else if pos('Access Denied', Inrec) > 0 then inc(tcan)
else if pos('Comment ', Inrec) > 0 then inc(comments)
else if pos(' DOOR ', Inrec) > 0 then pdoors
else if pos('Left:', Inrec) > 0 then inc(mssgs)
else if pos('not registered', Inrec) > 0 then inc(secviol)
else if pos('ock-', Inrec) > 0 then inc(lockouts)
else if pos('oined', Inrec) > 0 then confjoin
else if pos('Paged', Inrec) > 0 then inc(PAGE)
else if pos('Questionnaire ', Inrec) > 0 then inc(question)
else if pos('Refused', Inrec) > 0 then inc(refused)
else if pos('Scheduled', Inrec) > 0 then inc(events)
else if pos('Time Limit', Inrec) > 0 then inc(time_limit)
else if pos('Violation', Inrec) > 0 then inc(secviol)
end;
(* -------------------------------------------------------- *)
procedure scanfile;
var
tx1 : string[20];
a, y, p : integer;
minutoff,
houroff,
timeused : integer;
lastx : word;
begin
lastx := total_records;
total_records := first_record;
while (total_records <= lastx) do
begin
if total_records mod 30 = 1 then
begin
str((int(total_records)/int(logsize)*100.0) : 5 : 1, tx1);
tx1 := 'Working.... '+tx1+' %';
print(3, 17, tx1, 12);
end;
inc(total_records);
bseek(DiskFile, total_records);
getrec;
if pos(') (', Inrec) <> 0 then
incaller
else
if (pos('Minutes Used', Inrec) > 0) then
begin
p := pos(':', Inrec)+2;
y := p;
while (Inrec[y] >= '0') and (Inrec[y] <= '9') do
inc(y);
val(copy(Inrec, p, y-p), timeused, a);
getrec;
val(copy(Inrec, 11, 2), houroff, a);
if houroff > 23 then
houroff := houroff - 24;
val(copy(Inrec, 14, 2), minutoff, a);
while timeused > 0 do
begin
if timeused > minutoff then
a := minutoff
else
a := timeused;
UsedMinutes := UsedMinutes + a;
while UsedMinutes > 60 do
begin
inc(Hours);
UsedMinutes := UsedMinutes - 60;
end;
Hrs[houroff] := Hrs[houroff]+a;
timeused := timeused-a;
if houroff > 0 then
dec(houroff)
else
houroff := 23;
minutoff := 60;
end;
end
else
case Inrec[7] of
'*' :;
'(' : if inrec[9] <> ')' then inc(stuff)
else if inrec[8] = 'D' then indownload
else if inrec[8] = 'U' then indownload
else catchall;
'A' : if pos('Access Denied', Inrec) > 0 then inc(tcan)
else if pos('ARC view', Inrec) > 0 then inc(arcview)
else if pos('Archive view', Inrec) > 0 then inc(arcview)
else if pos('ARC test', Inrec) > 0 then inc(arctest)
else if pos('ARCM exe', Inrec) > 0 then inc(arcmail)
else catchall;
'B' : if pos('Bulletin Read:', Inrec) > 0 then bulletins
else if pos('Back from DOS', Inrec) > 0 then inc(backdos)
else catchall;
'C' : if pos('Comment ', Inrec) > 0 then inc(comments)
else if pos('Caller Exited to DOS ', Inrec) > 0 then DOSdrop
else catchall;
'D' : if pos('Directory Scan ', Inrec) > 0 then inc(dirscan)
else catchall;
'E' : if pos('Extract ', Inrec) > 0 then inc(extarc)
else catchall;
'F' : if pos('File (', Inrec) > 0 then inc(stuff)
else if pos('Free download', Inrec) > 0 then inc(free_down)
else catchall;
'K' : if pos('Keyboard Time',Inrec) > 0 then inc(stuff)
else catchall;
'I': if pos('Insufficient ',Inrec) > 0 then inc(secviol)
else if pos('Invalid archive',Inrec) > 0 then inc(invalids)
else catchall;
'M' : if pos('Left:', Inrec) > 0 then inc(mssgs)
else if pos('Killed:', Inrec) > 0 then inc(kills)
else catchall;
'N' : if pos('Node CHAT ent', Inrec) > 0 then sysop_chat
else if pos('Node CHAT end', Inrec) > 0 then inc(stuff)
else catchall;
'O' : if pos('Operator', Inrec) > 0 then inc(PAGE)
else if pos(' DOOR ', Inrec) > 0 then pdoors
else catchall;
'P' : if pos('Password Failure (', Inrec) > 0 then inc(pwfail)
else if pos('PAKM exe', Inrec) > 0 then inc(arcmail)
else catchall;
'R' : if pos('Refused', Inrec) > 0 then inc(refused)
else if pos('Registration', Inrec) > 0 then inc(new_guys)
else if pos('REARC ', Inrec) > 0 then inc(rearcs)
else if pos('REPAK ', Inrec) > 0 then inc(rearcs)
else catchall;
'S' : if pos('Scheduled', Inrec) > 0 then inc(events)
else if pos('Sorry', Inrec) > 0 then inc(secviol)
else if pos('Sysop CHAT a', Inrec) > 0 then sysop_chat
else if pos('Sysop CHAT e', Inrec) > 0 then inc(stuff)
else catchall;
'T' : if pos('Time Limit', Inrec) > 0 then inc(time_limit)
else if pos('TEST executed', Inrec) > 0 then inc(arctest)
else if pos('Thanks, ', Inrec) > 0 then inc(secviol)
else catchall;
'V' : if pos('View ARC', Inrec) > 0 then inc(viewmember)
else if pos('View archive', Inrec) > 0 then inc(viewmember)
else catchall;
'0'..'9':
if pos(' files,',Inrec) > 0 then batch
else if pos(' messages ',Inrec) > 0 then arcmsgs
else catchall;
else catchall;
end;
end;
tx1 := 'Working.... 100.0 %';
print(3, 17, tx1, 12);
end;
(* -------------------------------------------------------- *)
var
line: string;
xfd: text;
procedure write_list(node: ItemPointer);
begin
while node <> nil do
begin
writeln(xfd,node^.name);
writeln(xfd,node^.count);
node := node^.next;
end;
writeln(xfd);
end;
procedure write_tree(node: FilePointer);
begin
if node = nil then
writeln(xfd)
else
begin
writeln(xfd,node^.name);
writeln(xfd,node^.size,' ',node^.count);
write_tree(node^.higher);
write_tree(node^.lower);
end;
end;
(* -------------------------------------------------------- *)
procedure read_list(var node: ItemPointer);
var
add: ItemPointer;
begin
{special case - empty list}
readln(xfd,line);
if length(line) = 0 then
begin
node := nil;
exit;
end;
{insert head of list}
new(node);
add := node;
add^.name := line;
readln(xfd,add^.count);
{add rest of the list}
readln(xfd,line);
while length(line) <> 0 do
begin
new(add^.next);
add := add^.next;
add^.name := line;
readln(xfd,add^.count);
readln(xfd,line);
end;
add^.next := nil;
end;
procedure read_tree(var node: FilePointer);
begin
readln(xfd,line);
if length(line)=0 then
node := nil
else
begin
new(node);
node^.name := line;
read(xfd,node^.size);
readln(xfd,node^.count);
read_tree(node^.higher);
read_tree(node^.lower);
end;
end;
(* -------------------------------------------------------- *)
procedure save_state;
var
i: integer;
begin
gotoxy(1, 1);
write('Writing CALLS.SAV...');
assign(xfd,'calls.sav');
rewrite(xfd);
writeln(xfd,'-4');
writeln(xfd,
spare1,' ', spare2,' ',
spare3,' ', spare4,' ',
spare5,' ', spare6,' ',
spare7,' ', spare8,' ',
spare9,' ', B4800);
writeln(xfd,
arcmail,' ', msgcount,' ',
invalids,' ',mins_dn,' ',
mins_up,' ', mins_schat,' ',
nchat,' ', mins_nchat,' ',
arctest,' ', free_down);
writeln(xfd,
arcview,' ', B1200,' ',
B19200,' ', B2400,' ',
B300,' ', B9600,' ',
backdos,' ', batchs);
writeln(xfd,
Blocal,' ', blts,' ',
caller,' ', schat,' ',
comments,' ', dirscan,' ',
DOORs,' ', DosTime);
writeln(xfd,
DosTimes,' ', down,' ',
d_abort,' ', events,' ',
even_parity,' ', extarc,' ',
graphics,' ', Hours);
writeln(xfd,
joins,' ', kills,' ',
lockouts,' ', UsedMinutes,' ',
mssgs,' ', new_guys,' ',
non_graphics,' ', PAGE);
writeln(xfd,
pwfail,' ', question,' ',
rearcs,' ', refused,' ',
secviol,' ', stuff,' ',
sysop_local,' ', sysop_remote);
writeln(xfd,
tcan,' ', time_limit,' ',
TotHours:0:2,' ', UniqFiles,' ',
up,' ', u_abort,' ',
viewmember);
writeln(xfd,copy(first_rec,1,62));
for i := 1 to ProtocolCount do
with Protocol[i] do
writeln(xfd,
code,' ',
Uploads,' ',
UpTime:0:2,' ',
UpIdeal:0:2,' ',
Downloads,' ',
DownTime:0:2,' ',
DownIdeal:0:2);
for i := 0 to 23 do
writeln(xfd,Hrs[i]);
write_list(FirstBatch);
write_list(FirstBullet);
write_list(FirstConf);
write_list(FirstDoor);
write_tree(FileTree);
close(xfd);
writeln(^M' ');
end;
(* -------------------------------------------------------- *)
procedure load_state;
var
i: integer;
c: char;
begin
assign(xfd,'calls.sav');
{$i-} reset(xfd); {$i+}
if ioresult <> 0 then
exit;
gotoxy(1, 1);
writeln('Loading CALLS.SAV...');
read(xfd,filever);
if filever <> -4 then
begin
writeln('Can''t use your old CALLS.SAV file! Will create a new one.');
close(xfd);
exit;
end;
read(xfd,
spare1, spare2,
spare3, spare4,
spare5, spare6,
spare7, spare8,
spare9, B4800);
read(xfd,
arcmail, msgcount,
invalids, mins_dn,
mins_up, mins_schat,
nchat, mins_nchat,
arctest, free_down);
read(xfd,
arcview, B1200,
B19200, B2400,
B300, B9600,
backdos, batchs);
read(xfd,
Blocal, blts,
caller, schat,
comments, dirscan,
DOORs, DosTime);
read(xfd,
DosTimes, down,
d_abort, events,
even_parity, extarc,
graphics, Hours);
read(xfd,
joins, kills,
lockouts, UsedMinutes,
mssgs, new_guys,
non_graphics, PAGE);
read(xfd,
pwfail, question,
rearcs, refused,
secviol, stuff,
sysop_local, sysop_remote);
readln(xfd,
tcan, time_limit,
TotHours, UniqFiles,
up, u_abort,
viewmember);
readln(xfd,first_rec);
repeat
read(xfd,c);
i := 1;
while (i < ProtocolCount) and
(c <> Protocol[i].Code) and
(Protocol[i].Code <> '?') do
inc(i);
with Protocol[i] do
readln(xfd,Uploads,
UpTime,
UpIdeal,
Downloads,
DownTime,
DownIdeal);
until c = '?';
for i := 0 to 23 do
readln(xfd,Hrs[i]);
read_list(FirstBatch);
read_list(FirstBullet);
read_list(FirstConf);
read_list(FirstDoor);
read_tree(FileTree);
close(xfd);
writeln(^M' ');
end;
(* -------------------------------------------------------- *)
procedure load_dirs;
var
fd: text;
begin
search_dirs := 0;
(***
assign(fd,'calls.dir');
{$i-} reset(fd); {$i+}
if ioresult <> 0 then
begin
writeln('Warning: CALLS.DIR is missing.');
exit;
end;
while not eof(fd) do
begin
inc(search_dirs);
readln(fd,search_dir[search_dirs]);
end;
close(fd);
***)
end;
(* -------------------------------------------------------- *)
procedure init; {initialize}
begin
{Initialize the variables}
total_records := 0;
first_record := 0;
viewmember := 0;
extarc := 0;
rearcs := 0;
arctest := 0;
arcview := 0;
B1200 := 0;
B19200 := 0;
B2400 := 0;
B300 := 0;
B9600 := 0;
backdos := 0;
batchs := 0;
baud := 0;
Blocal := 0;
blts := 0;
caller := 0;
schat := 0;
comments := 0;
dirscan := 0;
DOORs := 0;
DosTime := 0;
DosTimes := 0;
down := 0;
d_abort := 0;
elapsed_time := 0;
Endtime := 0;
events := 0;
even_parity := 0;
free_down := 0;
graphics := 0;
Hours := 0;
joins := 0;
kills := 0;
lockouts := 0;
logsize := 0;
UsedMinutes := 0;
mssgs := 0;
new_guys := 0;
non_graphics := 0;
PAGE := 0;
pwfail := 0;
question := 0;
refused := 0;
secviol := 0;
start_time := 0;
stuff := 0;
sysop_local := 0;
sysop_remote := 0;
tcan := 0;
time_limit := 0;
TotHours := 0;
UniqFiles := 0;
up := 0;
u_abort := 0;
min_download := 0;
msgcount := 0;
arcmail := 0;
invalids := 0;
mins_dn := 0;
mins_up := 0;
mins_schat := 0;
nchat := 0;
mins_nchat := 0;
spare1 := 0; spare2 := 0; spare3 := 0; spare4 := 0; spare5 := 0;
spare6 := 0; spare7 := 0; spare8 := 0; spare9 := 0; B4800 := 0;
PeriodCovered := '';
reports := '';
first_rec := '';
FileTree := nil;
FirstBatch := nil;
FirstBullet := nil;
FirstConf := nil;
FirstDoor := nil;
fillchar(Hrs, sizeof(Hrs), 0);
elapsed_time := 0;
start_time := Time;
{provide command-line defaults}
outfile := 'BLT99';
reports := 'ANBCDEFGHIJKLM';
min_download := 2;
{ 1 2 }
{012345678901234567890123}
PeakTable := 'YNNNNNNNNNNNNNNNNYYYYYYY';
if paramcount < 1 then
begin
assign(output,''); {make redirection work so the usage}
rewrite(output); {can be captured in a file}
writeln;
writeln('Usage: calls callers-file output-file report-list min-downloads peak-hours');
writeln;
writeln('callers-file is your pcboard CALLER file');
writeln('output-file defaults to ',outfile);
writeln('report-list defaults to ',reports);
writeln('min-download defaults to ',min_download);
writeln;
writeln('peak-hours defaults to ',PeakTable);
writeln(' {0 1 2 }');
writeln(' {012345678901234567890123}');
writeln('Examples:');
writeln(' calls \pcb\main\caller \gen\blt3');
writeln(' calls \pcb\main\caller \gen\blt3 ABCEFG 4 NNNNNNNNYYYYYYYYYNNNNNNN');
writeln;
writeln('The legal report-list letters are:');
writeln(' A: system statistics B: graphic modes');
writeln(' C: baud rates D: hourly usage');
writeln(' E: conferences joined F: bulletins read');
writeln(' G: doors opened H: download protocols');
writeln(' I: download efficiency J: upload protocols');
writeln(' K: upload efficiency L: batch sizes');
writeln(' M: files downloaded N: security statistics');
writeln(' Z: insert a blank line');
halt;
end;
if paramcount > 1 then
outfile := paramstr(2);
if paramcount > 2 then
reports := paramstr(3);
if paramcount > 3 then
val(paramstr(4),min_download,total_records);
if paramcount > 4 then
PeakTable := paramstr(5);
clrscr;
print(13, 5, '╔═════════════════════════════════════════════════════╗', lightred);
print(13, 6, '║ ║', lightred);
print(13, 7, '║ ║', lightred);
print(13, 8, '║ ║', lightred);
print(13, 9, '║ ║', lightred);
print(13, 10, '║ ║', lightred);
print(13, 11, '║ ║', lightred);
print(13, 12, '║ ║', lightred);
print(13, 13, '║ ║', lightred);
print(13, 14, '║ ║', lightred);
print(13, 15, '╚═════════════════════════════════════════════════════╝', lightred);
print(32, 7, pcbversion, lightgreen);
print(30, 9, 'Calls v'+version+', '+reldate, lightgreen);
print(29, 11, '(c) 1987 Warren Lauzon', lightcyan);
print(20, 13, 'Supported by The Tool Shop, 602/279-2673', crt.white);
gotoxy(1,1);
end;
(* -------------------------------------------------------- *)
begin
init;
load_state;
load_dirs;
openfiles;
scanfile;
Endtime := Time;
elapsed_time := Endtime-start_time;
gotoxy(30, 17);
writeln('Elapsed Time: ', elapsed_time : 6 : 1);
output_results(outfile+'G');
red := '';
green := '';
yellow := '';
blue := '';
magenta := '';
cyan := '';
white := '';
gray := '';
output_results(outfile);
save_state;
gotoxy(1, 25);
end.